# pragma once
# include "windows.h"
# include <string>

struct IUnknown;
struct IDXGISwapChain;
struct ID3D11Device;
struct ID3D11DeviceContext;
struct ID3D11Texture2D;
struct ID3D11RenderTargetView;

class MonitorTextureDrawAble;
class CursorTextureDrawAble;
class RemoteTextureDrawAble;
class RenderTargerTexture;


class _declspec(dllimport) MyDx11 {
	friend class TextureDrawAble;
public:
	MyDx11(HWND _hwnd, int _window_width, int _window_height);
	void render();
	void copyData(ID3D11Device* _device, ID3D11DeviceContext* _context, ID3D11Texture2D* _texture, std::string _texture_name);
	void copyData(MyDx11* _myDx11, uint8_t* _buffer, size_t _size, std::string _texture_name);
	void createMonitorTexture(int _src_width, int _src_height);
	void removeMonitorTexture();
	void copyFromRenderTarget(uint8_t* _buffer, size_t _size);
	void renderToTexture(bool _draw_cursor);
	void resize(int _width, int _height);
	~MyDx11();
private:
	IDXGISwapChain* m_swap_chain = nullptr;
	ID3D11Device* m_device = nullptr;
	ID3D11DeviceContext* m_context = nullptr;
	ID3D11RenderTargetView* m_render_target_view = nullptr;

	MonitorTextureDrawAble* m_monitor_texture_draw_able = nullptr;
	CursorTextureDrawAble* m_cursor_texture_draw_able = nullptr;
	RemoteTextureDrawAble* m_remote_texture_draw_able = nullptr;
	bool m_remote = false;

	RenderTargerTexture* m_render_target_texture = nullptr;
	int m_window_width = 0;
	int m_window_height = 0;
};
